package application

import (
	"ruoyi/domain/entity/common"
	"ruoyi/domain/entity/response"
	"ruoyi/domain/entity/system"
	"ruoyi/domain/repository"
)

type DictApp struct {
	dict repository.SysDictDataRepository
}

var _ DictAppInterface = &DictApp{}

type DictAppInterface interface {
	SelectDictDataByType(dictType string) []system.SysDictData

	SelectDictDataList(params common.SearchTableDataParam, isPage bool) common.TableDataInfo

	FindDictCodeById(dictCode string) system.SysDictData

	SaveDictData(dictDataParam system.SysDictData) response.Response

	EditDictData(dictDataParam system.SysDictData) response.Response

	DeleteDictData(dictCodes string) response.Response
}

func (d *DictApp) SelectDictDataByType(dictType string) []system.SysDictData {
	return d.dict.SelectDictDataByType(dictType)
}

func (d *DictApp) SelectDictDataList(params common.SearchTableDataParam, isPage bool) common.TableDataInfo {
	return d.dict.SelectDictDataList(params, isPage)
}

func (d *DictApp) FindDictCodeById(dictCode string) system.SysDictData {
	return d.dict.FindDictCodeById(dictCode)
}

func (d *DictApp) SaveDictData(dictDataParam system.SysDictData) response.Response {
	return d.dict.SaveDictData(dictDataParam)
}

func (d *DictApp) EditDictData(dictDataParam system.SysDictData) response.Response {
	return d.dict.EditDictData(dictDataParam)
}

func (d *DictApp) DeleteDictData(dictCodes string) response.Response {
	return d.dict.DeleteDictData(dictCodes)
}
